<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="aa" uri="/WEB-INF/tld/ajaxanywhere.tld" %>
<%@ taglib tagdir="/WEB-INF/tags" prefix="app"%>

<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="viewport"
	content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>jsp</title>
<script src="/webjars/jquery/3.5.1/jquery.js"></script>
<script src="/aa.js"></script>
<link rel="stylesheet" href="/resources/css/bootstrap.min.css" />
<link rel="stylesheet" href="/resources/css/dashboard.css" />
</head>
<body>
	<h1>${param1}--${callback}</h1>
	<br />
	
	<br />
 
  <table class="table">
	  <tbody>
		  <c:if test="${page !=null && page.list !=null }">
			  <c:forEach var="o" items="${page.list}" varStatus="s"  >
				   <tr >
				      <th scope="row">
				      	<input type="checkbox" value="${o.id }" name="ck" >
				      </th>
				      <td colspan="2">${s.count} , id: ${o.id} , name: ${o.name} ,createDate: ${createDate}</td>
				      <td></td>
			    	</tr>
			  </c:forEach>
		  </c:if>
		<tr>
			<td colspan="2"></td>
		      <td scope="row">
		      	<input  class="btn btn-primary" type="button" value="确定" onclick="confirm();">
		      </td>
	       	 <td scope="row">
		      	<input class="btn btn-warning" type="button" value="关闭" oncilck="cancel();">
	     	 </td>
    	</tr>
	 </tbody>
</table>
</body>


<script type="text/javascript">

function getOpener (){
	if(opener){
			return opener.window; 
	}else {
			return parent.window;
	}
}

 function confirm(){
	 let idsArray = []
		if ($("input[name='ck']:checked").length == 0){
			  alert("请选择一条记录！");
			  return false;
	     }
		else{
		     $("input[name='ck']:checked").each(function (){
		    	 idsArray.push(this.value);
		     });
		}
	 if(getOpener()){
			getOpener().${callback}(idsArray);
		}
 }
 
 	
</script>
<script src="/resources/js/http.js"></script>
<script src="/resources/js/vue.global.prod.js"></script>
<script src="/resources/js/bootstrap.bundle.min.js"></script>
<script src="/resources/js/feather.min.js"></script>
</html>
	
